package com.yss.sofa.report.engine.cell.visible.form;

import com.yss.sofa.report.engine.Const;
import com.yss.sofa.report.engine.cell.ReportCell;

public class TextFormCell extends FormCell{
	private static final long serialVersionUID = -6743314982525720335L;
	private int minLength;
	private int maxLength;
	protected void init(){
		super.init();
		inputType=Const.FORM_INPUT_TYPE_TEXT;
		minLength=0;
		maxLength=Integer.MAX_VALUE;
	}
	public void assignTo(ReportCell cell){
		TextFormCell _=(TextFormCell)cell;
		super.assignTo(_);
		_.minLength=this.minLength;
		_.maxLength=this.maxLength;
	}
	public TextFormCell create(){
		TextFormCell _=new TextFormCell();
		this.assignTo(_);
		return _;
	}
	public String getRenderSource() {
		return "text-field";
	}
	@Override
	public boolean isCustom() {
		return false;
	}
	public int getMinLength() {
		return minLength;
	}
	public void setMinLength(int minLength) {
		this.minLength = minLength;
	}
	public int getMaxLength() {
		return maxLength;
	}
	public void setMaxLength(int maxLength) {
		this.maxLength = maxLength;
	}
	@Override
	public String getJsRaw(){
		return getJsValue();
	}
}
